<?php
	$arrCompanies = $_SESSION["login"]->getCompanies();
	foreach ($arrCompanies as $company) {
		$arrShops = $company->getShops();
		echo "<br/>";
		//var_dump($arrShops);
		foreach($arrShops as $shop){
			echo '
			<script>
				$(document).ready(function () {
					$("#SInfo'.$company->getId().''.$shop->getId().'").slideToggle(1550);
					$("#SInfoTrigger'.$company->getId().''.$shop->getId().'").click(function () {
						$("#SInfo'.$company->getId().''.$shop->getId().'").slideToggle(1500);
					});
				});
			</script>
			<div class="registration">

				<table class="profile profileShop" id="SInfoTrigger'.$company->getId().''.$shop->getId().'">
					<tr >
						<th colspan="3">
							Информация за Магазин "'.$shop->getName().'"
						</th>
					</tr>
				</table>
				<form action="?page=profile" method="post" class="registrationForm" class="cmxform">
				<table width="760" id="SInfo'.$company->getId().''.$shop->getId().'" style="display: block;">
					<tr>
						<td width="110px">
							 Име :
						</td>
						<td>
							<input type="text" name="shopName" id="shopName" maxlength="25"  value="'.$shop->getName().'"/>
						</td>
					</tr>
					<tr>
						<td>
							Адрес :
						</td>
						<td>
							<input type="text" name="shopAddress" id="shopAddress" maxlength="100"  value="'.$shop->getAddress().'"/>
						</td>
					</tr>
					<tr>
						<td>
							Телефон :
						</td>
						<td>
							<input type="text" name="phone" id="phone" maxlength="15"  value="'.$shop->getPhone().'"/>
						</td>

					</tr>
					<tr>
						<td>
							Доставка :
						</td>
						<td>
							'.$shop->getDelivery().'
						</td>

					</tr>';
			$arrPromotions = $shop->getShopPromo();

			if (count($arrPromotions)){
				echo '<tr>
						<td colspan="2" style="font-size: 15px; text-align: center; font-weight: bold; letter-spacing: 2px;padding: 10px">
							ПРОМОЦИИ
						</td>
					</tr>';
			}
			foreach ($arrPromotions as $promo){
				echo '<tr>
						<td>
							'.$promo->getStock().'
						</td>
						<td>
							'.$promo->getPromo().'%
						</td>

					</tr>';
			};
			echo    '<tr>
						<td>
							<input type="submit" name="shops" value="Промени" id="shops" />
						</td>
						<td>
							<input type="submit" name="shops" value="Изтрии" id="personal"/>
						</td>
					</tr>
				</table>
			</form>
		</div>';
		}
	}
?>
